Skip to content

Fix unpack with overloaded __iter__ method#14817

Merged
JukkaL merged 2 commits intomasterfrom
issue-14811
Mar 2, 2023
Merged

Fix unpack with overloaded __iter__ method#14817
JukkaL merged 2 commits intomasterfrom
issue-14811

Conversation

@sobolevn
Copy link
Copy Markdown
Member

@sobolevn sobolevn commented Mar 2, 2023

The change is quite simple: instead of manually unpacking the return type of find_item, we use the regular machinery for it.

Note, that this PR does not include any metaclasses related work. We still have problems with them, but I will defer them to the next PR.

Closes #14811
CC @AlexWaygood

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks good.

@JukkaL JukkaL merged commit bed49ab into master Mar 2, 2023
@JukkaL JukkaL deleted the issue-14811 branch March 2, 2023 12:23
@AlexWaygood
Copy link
Copy Markdown
Member

@sobolevn nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unpacking an iterable with an overloaded __iter__ method leads to variable silently being inferred as Any

3 participants